package cn.com.scitc.licenseplateback.model;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "MemberPayRecore", schema = "CubeLibrary", catalog = "")
public class MemberPayRecoreEntity {
    private String idNumber;
    private String openTime;
    private String openMonth;
    private double shouldMoney;
    private double actuleMoney;
    private boolean isSession;

    @Id
    @Column(name = "IDNumber", nullable = false, length = 18)
    public String getIdNumber() {
        return idNumber;
    }

    public void setIdNumber(String idNumber) {
        this.idNumber = idNumber;
    }

    @Basic
    @Column(name = "OpenTime", nullable = false)
    public String getOpenTime() {
        return openTime;
    }

    public void setOpenTime(String openTime) {
        this.openTime = openTime;
    }

    @Basic
    @Column(name = "OpenMonth", nullable = false)
    public String getOpenMonth() {
        return openMonth;
    }

    public void setOpenMonth(String openMonth) {
        this.openMonth = openMonth;
    }

    @Basic
    @Column(name = "ShouldMoney", nullable = false, precision = 2)
    public double getShouldMoney() {
        return shouldMoney;
    }

    public void setShouldMoney(double shouldMoney) {
        this.shouldMoney = shouldMoney;
    }

    @Basic
    @Column(name = "ActuleMoney", nullable = false, precision = 2)
    public double getActuleMoney() {
        return actuleMoney;
    }

    public void setActuleMoney(double actuleMoney) {
        this.actuleMoney = actuleMoney;
    }

    @Basic
    @Column(name = "IsSession", nullable = false)
    public boolean isSession() {
        return isSession;
    }

    public void setSession(boolean session) {
        isSession = session;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MemberPayRecoreEntity that = (MemberPayRecoreEntity) o;
        return Double.compare(that.shouldMoney, shouldMoney) == 0 &&
                Double.compare(that.actuleMoney, actuleMoney) == 0 &&
                isSession == that.isSession &&
                Objects.equals(idNumber, that.idNumber) &&
                Objects.equals(openTime, that.openTime) &&
                Objects.equals(openMonth, that.openMonth);
    }

    @Override
    public int hashCode() {
        return Objects.hash(idNumber, openTime, openMonth, shouldMoney, actuleMoney, isSession);
    }
}
